package tv_megazineplus
import pt.sapo.services.definitions.ESBCredentials;
import pt.sapo.services.metadata.contract.mobile.sms.SMSService;
import pt.sapo.services.metadata.contract.mobile.sms.SMSSoapSecure;
import javax.xml.ws.soap.SOAPFaultException;

class SendSmsService {

    static transactional = true

    def serviceMethod(orig, dest, sms){

		SMSSoapSecure service = (new SMSService()).getSMSSoapSecure()
		ESBCredentials auth = new ESBCredentials()

		auth.setESBUsername("danilo@danilo-souza.net")
		auth.setESBPassword("danilo01011989") // as tuas
//		XMLGregorianCalendar xgc = DatatypeFactory.newInstance()
//				.newXMLGregorianCalendar();
		try{
                    
                int res = service.sendSMSWithInternationalSupport(dest,
				sms, orig, true, null, 10, null, false, null,
				auth);
		
		}catch(SOAPFaultException e){
			printException("teste",e)
		}        
}
}
